<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ page isELIgnored="false" %>
<%@ include file="/interceptor.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>添加员工</title>
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		function setit(){
			var tel=/^1[0-9]{10}$/;
			var pname=document.getElementById("pname").value;
			var psex=document.getElementById("psex").value;
			var ptel=document.getElementById("ptel").value;
			if(pname == null||pname=="" ){
				alert("用户名不能为空！");
				return false;
			}else if(psex == null||psex=="" ){
				alert("性别不能为空！");
				return false;
			}else if(ptel == null||ptel==""){
				alert("手机号不能为空！");
				return false;
			}else if(!tel.test(ptel)){
				alert("手机号不合法！");
				return false;
			}else if(confirm("您确定要保存数据吗？")){
				document.forms[0].submit();
			}
			//alert("132");
		}

		function back() {
			history.go(-1);
		}
	</script>
</head>

<body>
<%-- <%@ include file="login_check.jsp" %> --%>

<form id="myForm" name="myForm" action="personadd" method="post">
		<div class="t">
			添加账号
		</div>
		<div class="pages">
			<table width="90%" border="0" cellspacing="0" cellpadding="0">
				<%--<tr>
					<td align="right" width="30%">id：</td>
					<td align="left"><input type="text" name="pid" id="pid"/> <font color="red">*</font></td>
				</tr>--%>
				<tr>
					<td align="right" width="30%">姓名：</td>
					<td align="left"><input type="text" name="pname" id="pname"/> <font color="red">*</font></td>
				</tr>
				<tr>
					<td align="right" width="30%">性别：</td>
					<td align="left">
						<select id="psex" name="psex">
							<option value="">请选择</option>
							<option value="男" >男</option>
							<option value="女" >女</option>
						</select>
					</td>
				</tr>
				<tr>
					<td align="right" width="30%">手机：</td>
					<td align="left"><input type="text" name="ptel" id="ptel" maxlength="11"/> <font color="red">*</font></td>
				</tr>
				<tr >
					<td align="center" colspan="2"><br/>
						<input type="button"  id="save" value="保存数据" onclick="setit();" />
						<%--<input id="subLogin"  name ="subLogin" type="submit" value="提交" />--%><!--提交按钮-->
						<input type="button"  id="re_to" value="返回" onclick="back();" />
					</td>
				</tr>
			</table>
		</div>
</form>
</body>
</html>